const express = require('express');
const router = express.Router();
const dashboardController = require('../controllers/dashboardController');
const { auth, manager } = require('../middlewares/auth');

// 所有路由都需要认证
router.use(auth);

// GET /api/dashboard/stats - 获取统计数据 (需要管理员或经理权限)
router.get('/stats', manager, dashboardController.getStats);

// GET /api/dashboard/charts - 获取图表数据 (需要管理员或经理权限)
router.get('/charts', manager, dashboardController.getCharts);

module.exports = router; 